﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Family_CancelBorrow : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void gvdata_Selected(object sender, SqlDataSourceStatusEventArgs e)
    {
        msg.Text = e.AffectedRows.ToString();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        GridViewRow gvr = gv.SelectedRow;
        if (gvr != null)
        {
            string juid = gvr.Cells[2].Text;
            string cuid = gvr.Cells[3].Text;
            DateTime bdate = DateTime.Parse(gvr.Cells[4].Text);
            string bid = gvr.Cells[5].Text;
            string jmobile = gvr.Cells[11].Text;
            DateTime dt = System.DateTime.Now;

            int i = XJX.Page.Helper.CallTemplater(6, "ToBorrowTitle", "ToBorrowTemplate", juid, bid, "", bdate);
            int j = XJX.Page.Helper.CallTemplater(6, "ToHolderTitle", "ToHolderTemplate", cuid, bid, jmobile, dt);

            if (i + j == 2)
            {
                Response.Write("<script>alert('发送成功！')</script>");
            }
            else
            {
                Response.Write("<script>alert('发送失败！')</script>");
            }
        }
    }
}